home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / h.dxr / 00006_••PIN Entry.ls < prev    next >
Encoding:
Text File  |  1996-02-15  |  1.8 KB  |  68 lines

  1. on DoPakey KeyNum
  2.   set currentPIN to field "PaPinText"
  3.   if integerp(KeyNum) then
  4.     if getaProp(getaProp(gObjects, #GasStation), #State) = #on then
  5.       put string(KeyNum) after field "PaPinText"
  6.       set charMax to 4
  7.       if the number of chars in field "PaPinText" = charMax then
  8.         setPaPINKeyState(#off)
  9.       end if
  10.     end if
  11.   else
  12.     if KeyNum = #enter then
  13.       set validPIN to getaProp(getaProp(gObjects, #PaKeyPad), #validPIN)
  14.       if currentPIN = validPIN then
  15.         doValidHosPIN()
  16.       else
  17.         doInValidHosPIN()
  18.       end if
  19.     else
  20.       if KeyNum = #delete then
  21.         delete char -30000 of field "PaPinText"
  22.         setPaPINKeyState(#on)
  23.       end if
  24.     end if
  25.   end if
  26. end
  27.  
  28. on doInValidHosPIN
  29.   setPaPINKeyState(#off)
  30.   Startthetimer(120, "doResetPINScreen")
  31. end
  32.  
  33. on setPaPINKeyState setState
  34.   if symbolp(setState) then
  35.     MakeDynamic(#PaKeyPad, #State, setState)
  36.   else
  37.     put "bad parameter passed to setShortKeyBoardState"
  38.   end if
  39. end
  40.  
  41. on doValidHosPIN
  42.   set whichPatient to getaProp(getaProp(gObjects, #PaPatients), #whichPatient)
  43.   if whichPatient = 8 then
  44.     set Credits to getaProp(gStates, #Credits)
  45.     set NurseObj to getaProp(gObjects, #NurseVid)
  46.     if getaProp(getaProp(gObjects, #PaMonitor), #HospPaid) <> #true then
  47.       if Credits >= 15000 then
  48.         MakeDynamic(#PaMonitor, #HospPaid, #true)
  49.         setaProp(gStates, #Credits, integer(Credits - 15000))
  50.         MakeDynamic(#NurseVid, #insufCreds, #false)
  51.       else
  52.         MakeDynamic(#NurseVid, #insufCreds, #true)
  53.       end if
  54.     end if
  55.     DoPaStatusGO()
  56.     doResetPINScreen()
  57.   else
  58.     setPaPINKeyState(#off)
  59.     Startthetimer(120, "doResetPINScreen")
  60.   end if
  61.   MakeDynamic(#PaMonitor, #PINEntered, #true)
  62. end
  63.  
  64. on doResetPINScreen
  65.   put EMPTY into field "PaPinText"
  66.   setPaPINKeyState(#on)
  67. end
  68.